﻿package mortal.game.view.autoArena
{
    import Message.DB.Tables.*;
    import Message.Public.*;
    import __AS3__.vec.*;
    import com.gengine.utils.*;
    import com.mui.controls.*;
    import com.mui.utils.*;
    import extend.language.*;
    import flash.events.*;
    import flash.geom.*;
    import frEngine.pools.*;
    import frEngine.primitives.object2d.*;
    import mortal.common.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.component.rotate3dModelSprite.*;
    import mortal.component.window.*;
    import mortal.game.cache.*;
    import mortal.game.manager.*;
    import mortal.game.manager.window3d.*;
    import mortal.game.mvc.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.scene3D.layer3D.utils.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.scene3D.player.info.*;
    import mortal.game.utils.*;
    import mortal.game.view.autoArena.util.*;
    import mortal.game.view.autoArena.view.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.display.*;
    import mortal.mvc.core.*;
    import mortal.mvc.interfaces.*;

    public class AutoArenaModule extends BaseWindow
    {
        private var _bg:GImageBitmap;
        private var _powerVec:Vector.<GImageBitmap>;
        private var _plusBtn1:GLoadedButton;
        private var _myRank:BitmapNumberText;
        private var _refreshBtn:GLoadingButton;
        private var _selfName:GTextFiled;
        private var _selfCombat:BitmapNumberText;
        private var _rotate3d:Rotate3dModelSprite;
        private var _rewardReviewBtn:GLoadingButton;
        private var _arenaRankBtn:GLoadingButton;
        private var _myRewardBtn:GLoadingButton;
        private var _challengeInfo:GTextFiled;
        private var _lookRecordBtn:GButton;
        private var _rect3d:Rect3DObject;
        private var _img2d:Img2D;
        private var _roleModelPlayer:RoleModelPlayer;
        private var _roleModelPlayer1:UserModelPlayer;
        private var _roleModelPlayer2:UserModelPlayer;
        private var _roleModelPlayer3:UserModelPlayer;
        private var _roleInfoArr:Array;
        private var _modelArr:Array;
        public static const ModelPos_Left:int = 0;
        public static const ModelPos_Mid:int = 1;
        public static const ModelPos_Right:int = 2;

        public function AutoArenaModule(param1:ILayer = null)
        {
            this._powerVec = new Vector.<GImageBitmap>;
            this._roleInfoArr = new Array();
            this._modelArr = new Array();
            super(param1);
            setSize(898 - 5, 616 - 4);
            title = Language.getString(40899);
            this.layer = LayerManager.windowLayer3D;
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            var _loc_2:GImageBitmap = null;
            super.createDisposedChildrenImpl();
            var _loc_1:int = 0;
            while (_loc_1 < 5)
            {
                
                _loc_2 = UIFactory.gImageBitmap(ImagesConst.AutoArena_Light, 113 + 17 * _loc_1, 134, this.contentTopOf3DSprite);
                this.pushUIToDisposeVec(_loc_2);
                this._powerVec.push(_loc_2);
                _loc_1++;
            }
            this._plusBtn1 = UIFactory.gLoadedButton(ImagesConst.sup3_upSkin, 203, 137, 16, 16, this.contentTopOf3DSprite);
            this._plusBtn1.configEventListener(MouseEvent.CLICK, this.onClickHandler);
            this._myRank = UIFactory.bitmapNumberText(134 - 2, 72, "AutoArenaRankNum.png", 19, 23, -1, this.contentTopOf3DSprite, 10, BitmapNumberText.Left);
            this._myRank.text = "";
            this._selfName = UIFactory.gTextField("", 16, 225 - 2, 208, 20, this.contentTopOf3DSprite, GlobalStyle.textFormatHuang.center());
            this._selfCombat = UIFactory.bitmapNumberText(109, (565 - 1), "EquipToolTipCombat.png", 14, 16, -2, this.contentTopOf3DSprite, 10);
            this._selfCombat.text = "";
            this._challengeInfo = UIFactory.gTextField("", 346, 580 - 2, 321, 20, this.contentTopOf3DSprite, GlobalStyle.textFormatBai);
            this.pushUIToDisposeVec(UIFactory.gTextField(Language.getString(40900), 674, 580 - 2, 96, 20, this.contentTopOf3DSprite, GlobalStyle.textFormatLv));
            this._refreshBtn = UIFactory.gLoadingButton(ResFileConst.AutoArenaRefreshBtn, 774, 571, 114, 33, this.contentTopOf3DSprite);
            this._refreshBtn.configEventListener(MouseEvent.CLICK, this.onClickHandler);
            this._rewardReviewBtn = UIFactory.gLoadingButton(ResFileConst.AutoArenaRewardPreviewBtn, 242 - 12, 52, 62, 63, this.contentTopOf3DSprite);
            this._rewardReviewBtn.configEventListener(MouseEvent.CLICK, this.onClickHandler);
            this._arenaRankBtn = UIFactory.gLoadingButton(ResFileConst.AutoArenaRankBtn, 314 - 14, 52, 62, 63, this.contentTopOf3DSprite);
            this._arenaRankBtn.configEventListener(MouseEvent.CLICK, this.onClickHandler);
            this._myRewardBtn = UIFactory.gLoadingButton(ResFileConst.AutoArenaMyRankBtn, 367, 52, 62, 63, this.contentTopOf3DSprite);
            this._myRewardBtn.configEventListener(MouseEvent.CLICK, this.onClickHandler);
            this._rotate3d = UIFactory.getUICompoment(Rotate3dModelSprite, 16, 243, this.contentTopOf3DSprite);
            this._rotate3d.setSize(208, 360);
            this._lookRecordBtn = UIFactory.gButton(Language.getString(41504), 234 - 2, 580 - 2, 110, 22, this.contentTopOf3DSprite, "GreenLinkButton");
            this._lookRecordBtn.configEventListener(MouseEvent.CLICK, this.onLookRecordHandler);
            this._bg = UIFactory.gImageBitmap(ImagesConst.AutoArena_Bg, 0, 0, null, this.onBgLoadCompl);
            this.onDayRewardUpdate();
            this.addListeners();
            return;
        }// end function

        private function addListeners() : void
        {
            NetDispatcher.addCmdListener(ServerCommand.AutoArenaGetMyInfo, this.onGetMyInfoHandler);
            NetDispatcher.addCmdListener(ServerCommand.AutoArenaGetChallengerInfo, this.onGetChallengerInfoHandler);
            Cache.instance.role.roleEntityInfo.addEventListener(EntityInfoEventName.UpdateComBat, this.updateRoleComBat);
            NetDispatcher.addCmdListener(ServerCommand.AutoArenaResetPowerSucc, this.onResetPowerSucc);
            NetDispatcher.addCmdListener(ServerCommand.AutoArenaGetRewardSucc, this.onTakeDayRewardSucc);
            NetDispatcher.addCmdListener(ServerCommand.AutoArenaUpdateDayReward, this.onDayRewardUpdate);
            NetDispatcher.addCmdListener(ServerCommand.AutoArenaGetMyRecord, this.onGetMyRecordHandler);
            return;
        }// end function

        private function removeListeners() : void
        {
            NetDispatcher.removeCmdListener(ServerCommand.AutoArenaGetMyInfo, this.onGetMyInfoHandler);
            NetDispatcher.removeCmdListener(ServerCommand.AutoArenaGetChallengerInfo, this.onGetChallengerInfoHandler);
            Cache.instance.role.roleEntityInfo.removeEventListener(EntityInfoEventName.UpdateComBat, this.updateRoleComBat);
            NetDispatcher.removeCmdListener(ServerCommand.AutoArenaResetPowerSucc, this.onResetPowerSucc);
            NetDispatcher.removeCmdListener(ServerCommand.AutoArenaGetRewardSucc, this.onTakeDayRewardSucc);
            NetDispatcher.removeCmdListener(ServerCommand.AutoArenaUpdateDayReward, this.onDayRewardUpdate);
            NetDispatcher.removeCmdListener(ServerCommand.AutoArenaGetMyRecord, this.onGetMyRecordHandler);
            return;
        }// end function

        private function onBgLoadCompl() : void
        {
            this.init3dRect();
            this._img2d = new Img2D(null, this._bg.bitmapData, new Rectangle(0, 0, 881, 572), false);
            this._rect3d.addImg(this._img2d);
            this.initRoleModel();
            this.reqInfo();
            return;
        }// end function

        private function reqInfo() : void
        {
            GameProxy.autoArena.getMyInfo();
            GameProxy.autoArena.getEnemysInfo();
            return;
        }// end function

        private function init3dRect() : void
        {
            this._rect3d = Rect3DManager.instance.registerWindow(true, new Rectangle(11, 40, 881, 572), this);
            Rect3DManager.instance.windowShowHander(null, this);
            return;
        }// end function

        private function initRoleModel() : void
        {
            if (this._rect3d)
            {
                this._roleModelPlayer = FrObjectPool.getObject(RoleModelPlayer, this);
                this._roleModelPlayer.entityInfo = Cache.instance.role.roleEntityInfo;
                this._roleModelPlayer.scaleAll = 1.4;
                this._roleModelPlayer.setRenderList(this._rect3d.renderList);
                this._rect3d.addObject3d(this._roleModelPlayer, 47 + 70 - 6, 294 + 191);
                this._rotate3d.model = this._roleModelPlayer;
            }
            return;
        }// end function

        private function onClickHandler(event:MouseEvent) : void
        {
            var desc:String;
            var e:* = event;
            if (e.target == this._plusBtn1)
            {
                var onRestPower:* = function () : void
            {
                if (AutoArenaUtil.isMoneyEnough())
                {
                    GameProxy.autoArena.resetPower();
                }
                return;
            }// end function
            ;
                if (Cache.instance.autoArena.currPower == 5)
                {
                    MsgManager.showRollTipsMsg(Language.getString(40901));
                    return;
                }
                desc = Language.getString(40902);
                TodayNotTipUtil.toDayNotTip(TodayNoTipsConst.ResetPower, onRestPower, desc, null, Alert.OK | Alert.CANCEL);
            }
            if (e.target == this._refreshBtn)
            {
                GameProxy.autoArena.getMyInfo();
                GameProxy.autoArena.getEnemysInfo();
            }
            if (e.target == this._rewardReviewBtn)
            {
                AutoArenaRankRuleWin.instance.show();
            }
            if (e.target == this._arenaRankBtn)
            {
                AutoArenaRankWin.instance.show();
            }
            if (e.target == this._myRewardBtn)
            {
                AutoArenaRewardSendWin.instance.show();
            }
            return;
        }// end function

        private function updateRoleComBat(event:Event) : void
        {
            if (Cache.instance.role.entityInfo.combat)
            {
                this._selfCombat.text = Cache.instance.role.entityInfo.combat.toString();
            }
            return;
        }// end function

        private function onGetMyInfoHandler(param1:Object) : void
        {
            var _loc_3:int = 0;
            var _loc_2:* = param1 as SAutoArenaMyInfo;
            if (_loc_2)
            {
                this._myRank.text = _loc_2.rank + "";
                _loc_3 = 0;
                while (_loc_3 < this._powerVec.length)
                {
                    
                    if (_loc_3 < _loc_2.power)
                    {
                        this._powerVec[_loc_3].filters = [];
                    }
                    else
                    {
                        this._powerVec[_loc_3].filters = [FilterConst.colorFilter2];
                    }
                    _loc_3++;
                }
                Cache.instance.autoArena.currPower = _loc_2.power;
                if (_loc_2.power == 0)
                {
                    EffectManager.glowFilterReg(this._plusBtn1);
                }
            }
            this._selfName.text = Cache.instance.role.entityInfo.name;
            this._selfCombat.text = Cache.instance.role.entityInfo.combat + "";
            GameProxy.autoArena.getMyRecord();
            return;
        }// end function

        private function onGetMyRecordHandler(param1:Object) : void
        {
            var _loc_4:SAutoArenaRecord = null;
            var _loc_5:SArenaBasePlayer = null;
            var _loc_6:String = null;
            var _loc_7:int = 0;
            var _loc_8:String = null;
            var _loc_9:String = null;
            var _loc_2:* = Cache.instance.autoArena.sAutoArenaMyInfo;
            var _loc_3:* = Cache.instance.autoArena.autoArenaRecordArr;
            if (_loc_3.length > 0)
            {
                _loc_4 = _loc_3[(_loc_3.length - 1)] as SAutoArenaRecord;
                _loc_7 = Cache.instance.autoArena.sAutoArenaMyInfo.rank;
                if (EntityUtil.isSelf(_loc_4.fromPlayer.entityId))
                {
                    _loc_5 = _loc_4.toPlayer;
                    _loc_8 = NameUtil.getProxyName(_loc_5.entityId) + HTMLUtil.addColor(_loc_5.name, GlobalStyle.colorLv);
                    _loc_9 = Language.getStringByParam(41653, _loc_5.combat);
                    _loc_6 = _loc_4.isFail ? (Language.getString(41654)) : (Language.getStringByParam(41655, _loc_4.rankChange));
                    this._challengeInfo.htmlText = Language.getStringByParam(41660, _loc_8 + _loc_9 + _loc_6);
                }
                else
                {
                    _loc_5 = _loc_4.fromPlayer;
                    _loc_8 = NameUtil.getProxyName(_loc_5.entityId) + HTMLUtil.addColor(_loc_5.name, GlobalStyle.colorLv);
                    _loc_9 = Language.getStringByParam(41653, _loc_5.combat);
                    _loc_6 = _loc_4.isFail ? (Language.getStringByParam(41657, _loc_4.rankChange)) : (Language.getString(41658));
                    this._challengeInfo.htmlText = Language.getStringByParam(41661, _loc_8 + _loc_9, _loc_6);
                }
            }
            return;
        }// end function

        private function onResetPowerSucc(param1:Object) : void
        {
            var _loc_2:* = param1 as int;
            Cache.instance.autoArena.currPower = _loc_2;
            var _loc_3:int = 0;
            while (_loc_3 < this._powerVec.length)
            {
                
                if (_loc_3 < _loc_2)
                {
                    this._powerVec[_loc_3].filters = [];
                }
                else
                {
                    this._powerVec[_loc_3].filters = [FilterConst.colorFilter2];
                }
                _loc_3++;
            }
            if (_loc_2 > 0)
            {
                EffectManager.glowFilterUnReg(this._plusBtn1);
            }
            return;
        }// end function

        private function onDayRewardUpdate(param1:Object = null) : void
        {
            var _loc_2:* = Cache.instance.autoArena.sAutoArenaDayReward;
            if (_loc_2 && !_loc_2.hadGet)
            {
                this._myRewardBtn.filterEnabled = true;
                this._myRewardBtn.mouseEnabled = true;
                EffectManager.glowFilterReg(this._myRewardBtn);
            }
            else
            {
                EffectManager.glowFilterUnReg(this._myRewardBtn);
                this._myRewardBtn.filterEnabled = false;
                this._myRewardBtn.mouseEnabled = false;
            }
            return;
        }// end function

        private function onTakeDayRewardSucc(param1:Object) : void
        {
            EffectManager.glowFilterUnReg(this._myRewardBtn);
            this._myRewardBtn.filterEnabled = false;
            this._myRewardBtn.mouseEnabled = false;
            return;
        }// end function

        private function onLookRecordHandler(event:MouseEvent) : void
        {
            AutoArenaMyRecordWin.instance.show();
            return;
        }// end function

        private function onGetChallengerInfoHandler(param1:Object) : void
        {
            var _loc_3:SAutoArenaMinPlayer = null;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            var _loc_6:int = 0;
            var _loc_7:int = 0;
            var _loc_8:AutoArenaRoleInfo = null;
            var _loc_9:int = 0;
            var _loc_2:* = Cache.instance.autoArena.sAutoArenaEnemys;
            if (_loc_2)
            {
                this.removeAllRoleInfo();
                this.removeRoleModel();
                _loc_9 = 0;
                while (_loc_9 < _loc_2.topPlayers.length)
                {
                    
                    _loc_3 = _loc_2.topPlayers[_loc_9] as SAutoArenaMinPlayer;
                    if (_loc_9 == 0)
                    {
                        _loc_4 = 600 + 16;
                        _loc_5 = 91;
                        _loc_6 = 600 + 53;
                        _loc_7 = 98 + 113;
                    }
                    if (_loc_9 == 1)
                    {
                        _loc_4 = 444 + 14;
                        _loc_5 = 102;
                        _loc_6 = 434 + 53;
                        _loc_7 = 109 + 113;
                    }
                    if (_loc_9 == 2)
                    {
                        _loc_4 = 751 + 14;
                        _loc_5 = 140;
                        _loc_6 = 751 - 3 + 53;
                        _loc_7 = 147 + 113;
                    }
                    _loc_8 = this.createInfoAndModel(_loc_3, _loc_4, _loc_5, _loc_6, _loc_7);
                    _loc_8.setPos(0);
                    _loc_8.isShowRank = false;
                    _loc_9++;
                }
                _loc_9 = 0;
                while (_loc_9 < _loc_2.enemyPlayers.length)
                {
                    
                    _loc_3 = _loc_2.enemyPlayers[_loc_9] as SAutoArenaMinPlayer;
                    if (_loc_9 == 0)
                    {
                        _loc_4 = 257 - 2;
                        _loc_5 = 178 - 2;
                        _loc_6 = 257 + 53 - 2 - 19;
                        _loc_7 = 178 + 113 - 2;
                    }
                    if (_loc_9 == 1)
                    {
                        _loc_4 = 397;
                        _loc_5 = 255;
                        _loc_6 = 397 + 53 - 19;
                        _loc_7 = 255 + 113;
                    }
                    if (_loc_9 == 2)
                    {
                        _loc_4 = 545;
                        _loc_5 = 302;
                        _loc_6 = 545 + 53 - 19;
                        _loc_7 = 302 + 113;
                    }
                    if (_loc_9 == 3)
                    {
                        _loc_4 = 702;
                        _loc_5 = 328;
                        _loc_6 = 702 + 53 - 19;
                        _loc_7 = 328 + 113;
                    }
                    _loc_8 = this.createInfoAndModel(_loc_3, _loc_4, _loc_5, _loc_6, _loc_7);
                    _loc_8.setPos(1);
                    _loc_8.isShowRank = true;
                    _loc_9++;
                }
            }
            return;
        }// end function

        private function createInfoAndModel(param1:SAutoArenaMinPlayer, param2:int, param3:int, param4:int, param5:int) : AutoArenaRoleInfo
        {
            var _loc_6:* = UICompomentPool.getUICompoment(AutoArenaRoleInfo);
            _loc_6.x = param2;
            _loc_6.y = param3;
            this.contentTopOf3DSprite.addChild(_loc_6);
            _loc_6.data = param1;
            this.addRoleModel(param1, param4, param5);
            this._roleInfoArr.push(_loc_6);
            return _loc_6;
        }// end function

        private function addRoleModel(param1:SAutoArenaMinPlayer, param2:int, param3:int) : void
        {
            var _loc_4:UserModelPlayer = null;
            var _loc_5:int = 0;
            var _loc_6:int = 0;
            var _loc_7:int = 0;
            var _loc_8:int = 0;
            var _loc_9:int = 0;
            var _loc_10:int = 0;
            var _loc_11:int = 0;
            var _loc_12:Boolean = false;
            var _loc_13:Boolean = false;
            var _loc_14:Boolean = false;
            if (param1)
            {
                _loc_4 = FrObjectPool.getObject(UserModelPlayer, this);
                _loc_5 = param1.career;
                _loc_6 = param1.sex;
                _loc_7 = this.getClothesModelId(param1.fashion);
                _loc_8 = this.getWeaponModelId(param1.weapon, _loc_5);
                _loc_9 = this.getWingModelId(param1.wing);
                _loc_10 = 0;
                _loc_11 = 0;
                _loc_12 = param1.fashion > 10000;
                _loc_13 = param1.wing > 10000;
                _loc_14 = param1.weapon > 10000;
                _loc_4.updateIsShowEffect(_loc_14, _loc_12, _loc_13);
                _loc_4.updateInfo(_loc_5, _loc_6, _loc_7, _loc_8, _loc_10, _loc_9, _loc_11);
                _loc_4.scaleAll = 1;
                _loc_4.useLight();
                this._rect3d.addObject3d(_loc_4, param2, param3);
                this._modelArr.push(_loc_4);
            }
            return;
        }// end function

        private function getClothesModelId(param1:int) : int
        {
            var _loc_2:int = 0;
            var _loc_3:ItemEquipInfo = null;
            var _loc_4:int = 0;
            var _loc_5:TMountConfig = null;
            if (param1 > 10000)
            {
                _loc_3 = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
                _loc_2 = _loc_3 ? (_loc_3.modelId) : (0);
            }
            else
            {
                _loc_4 = param1 == 0 ? (1) : (param1);
                _loc_5 = MountConfig.instance.getFashionInfoByCode(EAdvanceComponentType._EAdvanceComponentTypeClothes, _loc_4);
                _loc_2 = _loc_5 ? (_loc_5.modelId) : (0);
            }
            return _loc_2;
        }// end function

        private function getWingModelId(param1:int) : int
        {
            var _loc_2:int = 0;
            var _loc_3:ItemEquipInfo = null;
            var _loc_4:TMountConfig = null;
            if (param1 > 10000)
            {
                _loc_3 = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
                _loc_2 = _loc_3 ? (_loc_3.modelId) : (0);
            }
            else
            {
                _loc_4 = MountConfig.instance.getFashionInfoByCode(EAdvanceComponentType._EAdvanceComponentTypeWing, param1);
                _loc_2 = _loc_4 ? (_loc_4.modelId) : (0);
            }
            if (_loc_2 == 0)
            {
                _loc_2 = 130035;
            }
            return _loc_2;
        }// end function

        private function getWeaponModelId(param1:int, param2:int) : int
        {
            var _loc_3:int = 0;
            var _loc_4:ItemEquipInfo = null;
            var _loc_5:TMountConfig = null;
            if (param1 > 10000)
            {
                _loc_4 = ItemConfig.instance.getConfig(param1) as ItemEquipInfo;
                _loc_3 = _loc_4 ? (_loc_4.modelId) : (0);
            }
            else
            {
                _loc_5 = MountConfig.instance.getFashionInfoByCode(EAdvanceComponentType._EAdvanceComponentTypeWing, param1);
                _loc_3 = _loc_5 ? (_loc_5.modelId) : (0);
            }
            if (_loc_3 == 0)
            {
                switch(param2)
                {
                    case ECareer._ECareerWarrior:
                    {
                        _loc_3 = 110046;
                        break;
                    }
                    case ECareer._ECareerArcher:
                    {
                        _loc_3 = 110002;
                        break;
                    }
                    case ECareer._ECareerMage:
                    {
                        _loc_3 = 110004;
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
            }
            return _loc_3;
        }// end function

        private function removeAllRoleInfo() : void
        {
            var _loc_1:AutoArenaRoleInfo = null;
            for each (_loc_1 in this._roleInfoArr)
            {
                
                _loc_1.dispose();
                _loc_1 = null;
            }
            this._roleInfoArr.length = 0;
            return;
        }// end function

        private function removeRoleModel() : void
        {
            var _loc_1:UserModelPlayer = null;
            if (this._rect3d)
            {
                for each (_loc_1 in this._modelArr)
                {
                    
                    if (_loc_1)
                    {
                        this._rect3d.disposeObj3d(_loc_1);
                        this._roleModelPlayer = null;
                    }
                }
            }
            return;
        }// end function

        private function remove3D() : void
        {
            if (this._rect3d)
            {
                if (this._img2d)
                {
                    this._rect3d.removeImg(this._img2d);
                    this._img2d = null;
                }
                this.removeRoleModel();
                if (this._roleModelPlayer)
                {
                    this._rect3d.disposeObj3d(this._roleModelPlayer);
                    this._roleModelPlayer = null;
                }
                Rect3DManager.instance.disposeRect3d(this._rect3d);
                this._rect3d = null;
            }
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl();
            this._bg.dispose();
            this._bg = null;
            this._plusBtn1.dispose();
            this._plusBtn1 = null;
            this._myRank.dispose();
            this._myRank = null;
            this._refreshBtn.dispose();
            this._refreshBtn = null;
            this._arenaRankBtn.dispose();
            this._arenaRankBtn = null;
            this._selfName.dispose();
            this._selfName = null;
            this._selfCombat.dispose();
            this._selfCombat = null;
            this._rotate3d.dispose();
            this._rotate3d = null;
            this._rewardReviewBtn.dispose();
            this._rewardReviewBtn = null;
            this._myRewardBtn.dispose();
            this._myRewardBtn = null;
            this._challengeInfo.dispose();
            this._challengeInfo = null;
            this._lookRecordBtn.dispose();
            this._lookRecordBtn = null;
            this._powerVec.length = 0;
            this.remove3D();
            this.removeAllRoleInfo();
            this._modelArr.length = 0;
            this._roleInfoArr.length = 0;
            this.removeListeners();
            return;
        }// end function

    }
}
